//
//  Deal.m
//  团购
//
//  Created by mj on 13-11-2.
//  Copyright (c) 2013年 itcast. All rights reserved.
//

#import "TGDealModel.h"
#import "MJExtension.h"
#import "NSString+Extend.h"
#import "NSDate+Extend.h"

@implementation TGDealModel

+(void)load{
    [TGDealModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
        return @{@"desc" : @"description"};
    }];
    
    [TGDealModel mj_setupObjectClassInArray:^NSDictionary *{
        return @{@"businesses" : @"TGBusinessModel"};
    }];
}
+(instancetype)dealModelWithDict:(NSDictionary *)dict{
    return [self mj_objectWithKeyValues:dict];
}

- (void)setList_price:(double)list_price{
    _list_price = list_price;
    _list_price_text = [NSString stringWithDouble:list_price fractionCount:2];
}

- (void)setCurrent_price:(double)current_price{
    _current_price = current_price;
    _current_price_text = [NSString stringWithDouble:current_price fractionCount:2];
}

- (BOOL)isEqual:(TGDealModel *)other{
    return [other.deal_id isEqualToString:_deal_id];
}

@end
